package com.ddtech.business.check.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ddtech.business.check.entity.Check;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 考核表 Mapper 接口
 * </p>
 *
 * @author bin_pu
 * @since 2023-02-06
 */
@Mapper
public interface CheckMapper extends BaseMapper<Check> {
    /**
     * 查询考核列表
     * @param populatePage
     * @param checkName
     * @param checkType
     * @return
     */
    IPage<Map<String,Object>> getPageList(IPage populatePage, @Param("checkName") String checkName, @Param("checkType") Integer checkType);

    /**
     * 考试统计
     * @param userId
     * @param type
     * @return
     */
    Map<String, Object> getUserExamStatistics(@Param("userId") String userId, @Param("type") Integer type);

    /**
     * 獲取最近7次考试记录
     * @param userId
     * @param type
     * @return
     */
    List<Map<String, Object>> getLatelyExamInfo(String userId, Integer type);
}
